home *** CD-ROM | disk | FTP | other *** search
/ AmigActive 2 / AACD 2.iso / AACDprefs < prev    next >
Text File  |  1999-10-02  |  17KB  |  455 lines

  1. /*
  2. Preferences editor for Amiga Active CDs
  3. $VER: AACDprefs 1.3 (26.8.99) by Neil Bothwick
  4. */
  5.  
  6. /* ;;; Initialise */
  7. options results
  8. signal on error
  9. CurrStack = pragma('S',16384)
  10. if CurrStack > 16384 then call pragma('S',CurrStack)
  11.  
  12. VerStr       = sourceline(3)
  13. VerStr       = subword(VerStr,2,words(VerStr) - 4)
  14. WinTitle     = 'Amiga Active CD preferences'
  15. GuiPort      = 'AACDPREFS'
  16. PrgPort      = GuiPort'.1'
  17. CDPrefs      = 'ENV:AACD.prefs'
  18. IderPrefs    = 'ENV:AACDfile.prefs'
  19. DefCDPrefs   = 'CDTools/S/AACD.prefs'
  20. DefIderPrefs = 'CDTools/S/AACDfile.prefs'
  21. FileTypes    = 'IFF GIF JPG PNG ANM MPG MOV AVI PDF SVX WAV S3M XMM MED DBM MOD MP3 MID AGD HTM LHA DEF'
  22. Settings     = 'CPU FPU PPC GFX'
  23. CmdHelp      = '"Command for this type of file"'
  24. ArgHelp      = '"Arguments for this command\nThe filename will be added to the end.\nUse %s to include the filename somewhere else."'
  25. Filetype.0   = 'AACDfile'
  26. Filetype.1   = 'Directory Opus'
  27.  
  28. MUIA_Menuitem_Shortcut              = 0x80422030
  29. MUIM_Application_AboutMUI           = 0x8042d21d
  30. MUIM_Application_OpenConfigWindow   = 0x804299ba
  31. MUIA_Group_SameHeight               = 0x8042037e
  32. MUIA_Group_SameWidth                = 0x8042b3ec
  33. MUIA_Group_Spacing                  = 0x8042866d
  34. MUIA_Group_Columns                  = 0x8042f416
  35. MUIA_Group_Rows                     = 0x8042b68f
  36. MUIA_Selected                       = 0x8042654b
  37. MUIA_Disabled                       = 0x80423661
  38. MUIA_Application_Author             = 0x80424842
  39. MUIA_Application_Copyright          = 0x8042ef4d
  40. MUIA_Application_Description        = 0x80421fc6
  41. MUIA_Application_Title              = 0x804281b8
  42. MUIA_Application_Version            = 0x8042b33f
  43. /*monitor on 'CON:0/0/600/180/AACDPrefs/CLOSE/AUTO'*/
  44.  
  45. call LoadLib('rexxsupport.library')
  46. call LoadLib('rexxdossupport.library')
  47. call LoadLib('rexxreqtools.library')
  48. ;;;
  49. /* ;;; Create main window */
  50. thisport = openport(PrgPort)
  51. if thisport = 0 then exit
  52. address(GuiPort)
  53. window id MAIN port PrgPort command 'QUIT' title '"'WinTitle'"'
  54. ;;;
  55. /* ;;; Menus */
  56.     menu ID PROJM label 'Project'
  57.         item ID ABOUM port PrgPort command '"ABOUT"' ATTRS MUIA_Menuitem_Shortcut '"?"' label 'About'
  58.         item  port GuiPort command '"method 'MUIM_Application_AboutMUI' 0"' label 'About MUI'
  59.         menu ID SETTM label 'Settings'
  60.             item port PrgPort command '"method 'MUIM_Application_OpenConfigWindow'"' label 'MUI...'
  61.             endmenu
  62.         item ID QUITM port PrgPort command 'QUIT' ATTRS MUIA_Menuitem_Shortcut 'Q' label 'Quit'
  63.         endmenu
  64.     menu ID EDITM label 'Edit'
  65.         item ID RESTM port PrgPort command '"RESTORE"' ATTRS MUIA_Menuitem_Shortcut 'D' label 'Restore to Defaults'
  66.         item ID LASTM port PrgPort command '"LOAD"' ATTRS MUIA_Menuitem_Shortcut 'L' label 'Last saved'
  67.         endmenu
  68. ;;;
  69. /* ;;; Info */
  70.     group id TABS REGISTER LABELS 'Info,System,Filetypes'
  71.         view file 'CDTools/S/AACDprefs.txt'
  72. ;;;
  73. /* ;;; System */
  74.         group ATTRS MUIA_Group_Columns 4
  75.             space HORIZ
  76.             label 'Filetypes'
  77.             cycle id FTYPE help '"Use Directory Opus filetypes\nor AACDfile settings."' labels Filetype.0','Filetype.1
  78.             space HORIZ
  79.             space HORIZ
  80.             label 'CPU'
  81.             cycle id CPU help '"Some functions have CPU optimised versions,\nset this to ensure you get the best options"' labels '68000,68020,68030,68040,68060'
  82.             space HORIZ
  83.             space HORIZ
  84.             label 'FPU'
  85.             cycle id FPU help '"WARNING:\nSelecting this when you do not have an FPU\nmay crash some programs"' labels 'No FPU,FPU'
  86.             space HORIZ
  87.             space HORIZ
  88.             label 'PPC'
  89.             cycle id PPC help '"Type of PPC processor, if fitted"' labels 'None,603,604'
  90.             space HORIZ
  91.             space HORIZ
  92.             label 'Graphics system'
  93.             cycle id GFX help '"Select the type of graphics\nyour Amiga uses"' labels 'AGA,OCS,CyberGraphX,Picasso96'
  94.             space HORIZ
  95.             space HORIZ
  96.             /*
  97.             label 'Summat else'
  98.             cycle id SUMAT help '"I am sure there was something else I\nneeded to include. I suppose I will\nthink of it just after the CD is mastered."' labels 'Option 1,Option 2,Option 3,Option 4'
  99.             space HORIZ
  100.             */
  101.             endgroup
  102. ;;;
  103. /* ;;; Filetypes */
  104.         group id FTABS REGISTER LABELS 'Images,Sounds,Other'
  105. ;;;
  106. /* ;;; Images */
  107.             group ATTRS MUIA_Group_Columns 3
  108.                 label DOUBLE LEFT '\033b\033uFiletype'
  109.                 label DOUBLE LEFT '\033b\033uCommand'
  110.                 label DOUBLE LEFT '\033b\033uArguments'
  111.                 label DOUBLE LEFT 'IFF Picture'
  112.                     popasl ID IFF0 port PrgPort command '"Check %s"' help '"Command to view IFF pictures"'
  113.                     string ID IFF1 help ArgHelp
  114.                 label DOUBLE LEFT 'GIF Picture'
  115.                     popasl ID GIF0 port PrgPort command '"Check %s"' help '"Command to view GIF pictures"'
  116.                     string ID GIF1 help ArgHelp
  117.                 label DOUBLE LEFT 'JPEG Picture'
  118.                     popasl ID JPG0 port PrgPort command '"Check %s"' help '"Command to view JPEG pictures"'
  119.                     string ID JPG1 help ArgHelp
  120.                 label DOUBLE LEFT 'PNG Picture'
  121.                     popasl ID PNG0 port PrgPort command '"Check %s"' help '"Command to view PNG pictures"'
  122.                     string ID PNG1 help ArgHelp
  123.                 label DOUBLE LEFT 'IFF Anim'
  124.                     popasl ID ANM0 port PrgPort command '"Check %s"' help '"Command to view IFF animations"'
  125.                     string ID ANM1 help ArgHelp
  126.                 label DOUBLE LEFT 'MPEG Video'
  127.                     popasl ID MPG0 port PrgPort command '"Check %s"' help '"Command to view MPEG video"'
  128.                     string ID MPG1 help ArgHelp
  129.                 label DOUBLE LEFT 'Quicktime Video'
  130.                     popasl ID MOV0 port PrgPort command '"Check %s"' help '"Command to view Quicktime movies"'
  131.                     string ID MOV1 help ArgHelp
  132.                 label DOUBLE LEFT 'AVI Video'
  133.                     popasl ID AVI0 port PrgPort command '"Check %s"' help '"Command to view AVI video"'
  134.                     string ID AVI1 help ArgHelp
  135.                 label DOUBLE LEFT 'Adobe PDF'
  136.                     popasl ID PDF0 port PrgPort command '"Check %s"' help '"Command to view Adobe Acrobat PDF files"'
  137.                     string ID PDF1 help ArgHelp
  138.                 space
  139.                 endgroup
  140. ;;;
  141. /* ;;; Sounds */
  142.             group ATTRS MUIA_Group_Columns 3
  143.                 label DOUBLE LEFT '\033b\033uFiletype'
  144.                 label DOUBLE LEFT '\033b\033uCommand'
  145.                 label DOUBLE LEFT '\033b\033uArguments'
  146.                 label DOUBLE LEFT 'IFF Sample'
  147.                     popasl ID SVX0 port PrgPort command '"Check %s"' help '"Command to play IFF samples"'
  148.                     string ID SVX1 help ArgHelp
  149.                 label DOUBLE LEFT 'WAV Sample'
  150.                     popasl ID WAV0 port PrgPort command '"Check %s"' help '"Command to play WAV samples"'
  151.                     string ID WAV1 help ArgHelp
  152.                 label DOUBLE LEFT 'S3M Module'
  153.                     popasl ID S3M0 port PrgPort command '"Check %s"' help '"Command to play S3M modules"'
  154.                     string ID S3M1 help ArgHelp
  155.                 label DOUBLE LEFT 'XM Module'
  156.                     popasl ID XMM0 port PrgPort command '"Check %s"' help '"Command to play XM modules"'
  157.                     string ID XMM1 help ArgHelp
  158.                 label DOUBLE LEFT 'MED Module'
  159.                     popasl ID MED0 port PrgPort command '"Check %s"' help '"Command to play OctaMED modules"'
  160.                     string ID MED1 help ArgHelp
  161.                 label DOUBLE LEFT 'DBM Module'
  162.                     popasl ID DBM0 port PrgPort command '"Check %s"' help '"Command to play DigiBooster modules"'
  163.                     string ID DBM1 help ArgHelp
  164.                 label DOUBLE LEFT 'Other Module'
  165.                     popasl ID MOD0 port PrgPort command '"Check %s"' help '"Command to play other modules"'
  166.                     string ID MOD1 help ArgHelp
  167.                 label DOUBLE LEFT 'MPEG Audio'
  168.                     popasl ID MP30 port PrgPort command '"Check %s"' help '"Command to play MPEG audio"'
  169.                     string ID MP31 help ArgHelp
  170.                 label DOUBLE LEFT 'MIDI'
  171.                     popasl ID MID0 port PrgPort command '"Check %s"' help '"Command to play midi files"'
  172.                     string ID MID1 help ArgHelp
  173.                 space
  174.                 endgroup
  175. ;;;
  176. /* ;;; Others */
  177.             group ATTRS MUIA_Group_Columns 3
  178.                 label DOUBLE LEFT '\033b\033uFiletype'
  179.                 label DOUBLE LEFT '\033b\033uCommand'
  180.                 label DOUBLE LEFT '\033b\033uArguments'
  181.                 label DOUBLE LEFT 'AmigaGuide'
  182.                     popasl ID AGD0 port PrgPort command '"Check %s"' help '"Command to view AmigaGuide documents"'
  183.                     string ID AGD1 help ArgHelp
  184.                 label DOUBLE LEFT 'HTML'
  185.                     popasl ID HTM0 port PrgPort command '"Check %s"' help '"Command to view HTML documents"'
  186.                     string ID HTM1 help ArgHelp
  187.                 label DOUBLE LEFT 'LhA archive'
  188.                     popasl ID LHA0 port PrgPort command '"Check %s"' help '"Command to list LhA archives"'
  189.                     string ID LHA1 help ArgHelp
  190.                 label DOUBLE LEFT 'Default'
  191.                     popasl ID DEF0 port PrgPort command '"Check %s"' help '"Command to show all other file types"'
  192.                     string ID DEF1 help ArgHelp
  193.                 space
  194.                 endgroup
  195.             endgroup
  196.         endgroup
  197. ;;;
  198. /* ;;; Buttons */
  199.     group HORIZ
  200.         button ID SAVE   port PrgPort command '"UsePrefs(1)"' help '"Save the settings to\nyour hard drive"' label 'Save'
  201.         button ID USE    port PrgPort command '"UsePrefs"'  help '"Use the settings for this session"' label 'Use'
  202.         button ID CANCEL port PrgPort command '"Quit"'      help '"Exit without changing the settings"' label 'Cancel'
  203.         endgroup
  204.     endwindow
  205. ;;;
  206. /* ;;; Set application details */
  207. address(GuiPort)
  208. 'application' MUIA_Application_Version VerStr
  209. 'application' MUIA_Application_Author 'Neil Bothwick'
  210. 'application' MUIA_Application_Copyright '© 1999 by Neil Bothwick, Wirenet'
  211. 'application' MUIA_Application_Title 'AACDprefs'
  212. 'application' MUIA_Application_Description 'Search AmigAactive CD, Aminet CD and Aminet index files'
  213. ;;;
  214. /* ;;; Main loop */
  215. call LoadPrefs()
  216. do forever
  217.     call waitpkt(PrgPort)
  218.     packet = getpkt(PrgPort)
  219.     if packet = '0000 0000'x then iterate
  220.     cmd = getarg(packet)
  221.     call reply(packet,0)
  222.     parse var cmd cmd args
  223.     interpret 'call 'cmd'("'args'")'
  224.     end
  225. ;;;
  226. /* ;;; Load prefs */
  227. LoadPrefs:
  228.     /* Load system settings */
  229.     if exists(CDPrefs) then PrefsFile = CDPrefs
  230.     else do
  231.         PrefsFile = DefCDPrefs
  232.         call ShowMsg('No system settings found, using defaults')
  233.         end
  234.     if ~open(prefs,PrefsFile,'R') then do
  235.         call ShowMsg('Failed to read system preferences file')
  236.         exit
  237.         end
  238.     do until eof(prefs)
  239.         PrefsLine = readln(prefs)
  240.         if PrefsLine = '' then iterate
  241.         if pos(left(PrefsLine,1),';#') > 0 then iterate
  242.         if left(PrefsLine,11) = 'CLASS=HTML2' 0 then iterate
  243.         parse var PrefsLine setting '=' value
  244.         interpret 'cycle id' setting 'label' value
  245.         end
  246.     call close(prefs)
  247.  
  248.     /* Load filetype settings */
  249.     if exists(IderPrefs) then PrefsFile = IderPrefs
  250.     else do
  251.         PrefsFile = DefIderPrefs
  252.         call ShowMsg('No filetype settings found, using defaults')
  253.         end
  254.     if ~open(prefs,PrefsFile,'R') then do
  255.         call ShowMsg('Failed to read filetype preferences file')
  256.         exit
  257.         end
  258.  
  259.     PrefsLine = readln(prefs)
  260.     setvar CfgVersion PrefsLine
  261.     ClassCount = 0
  262.     UseOpus = 0
  263.  
  264.     do until eof(prefs)
  265.         PrefsLine = readln(prefs)
  266.         if PrefsLine = '' then iterate
  267.         if pos(left(PrefsLine,1),';#') > 0 then iterate
  268.         ClassCount = ClassCount + 1
  269.         PrefsLine = substr(PrefsLine,pos('CLASS=',upper(PrefsLine)) + 6)
  270.         if left(PrefsLine,1) = '"' then parse var Prefsline '"' Class '"' PrefsLine /*Class = substr(PrefsLine,2,pos('"',PrefsLine,2) - 2)*/
  271.         else parse var PrefsLine Class PrefsLine
  272.         PrefsLine = strip(PrefsLine)
  273.         parse var PrefsLine Defn 'ACTION=' Action
  274.         interpret Class'.cmd="'word(Action,1)'"'
  275.         interpret Class'.arg="'subword(Action,2)'"'
  276.         if ClassCount = 1 & upper(Class) = 'DEFAULT' then UseOpus = 1
  277.         end
  278.     call close(prefs)
  279.  
  280.     cycle id FTYPE label Filetype.UseOpus
  281.     call LoadGadgets('IFF','IFF_picture')
  282.     call LoadGadgets('GIF','GIF_picture')
  283.     call LoadGadgets('JPG','JPEG_picture')
  284.     call LoadGadgets('PNG','PNG_Picture')
  285.     call LoadGadgets('ANM','ANIM')
  286.     call LoadGadgets('MPG','MPEG_Video')
  287.     call LoadGadgets('MOV','Quicktime_Movie')
  288.     call LoadGadgets('AVI','AVI_Video')
  289.     call LoadGadgets('PDF','PDF_file')
  290.     call LoadGadgets('SVX','IFF_Sample')
  291.     call LoadGadgets('WAV','WAV_Sample')
  292.     call LoadGadgets('S3M','S3M_Module')
  293.     call LoadGadgets('XMM','XM_Module')
  294.     call LoadGadgets('MED','MED_Module')
  295.     call LoadGadgets('DBM','DBM_Module')
  296.     call LoadGadgets('MOD','Module')
  297.     call LoadGadgets('MP3','MPEG_Audio')
  298.     call LoadGadgets('MID','MIDI')
  299.     call LoadGadgets('AGD','Guide')
  300.     call LoadGadgets('HTM','HTML')
  301.     call LoadGadgets('LHA','LhA_Archive')
  302.     call LoadGadgets('DEF','Default')
  303.     return
  304. ;;;
  305. /* ;;; Set gadgets */
  306. LoadGadgets:
  307.     NM = arg(1)
  308.     Class = arg(2)
  309.     if symbol(Class'.cmd') = 'VAR' then do
  310.         interpret 'popasl ID 'NM'0 CONTENT 'Class'.cmd'
  311.         interpret 'string ID 'NM'1 CONTENT 'Class'.arg'
  312.         end
  313.     else do
  314.         interpret 'popasl ID 'NM'0 CONTENT "Execute"'
  315.         interpret 'string ID 'NM'1 CONTENT ":CDTools/S/NoAction"'
  316.         end
  317.     return
  318. ;;;
  319. /* ;;; Use prefs */
  320. UsePrefs:
  321.     parse arg sav
  322.  
  323.     /* Save system settings */
  324.     if ~open(prefs,CDPrefs,'W') then call ShowMsg('Failed to save preferences')
  325.     else do
  326.         call writeln(prefs,'# Amiga Active CD preferences - created by AACDprefs' word(sourceline(3),3)'0a'x)
  327.         do i = 1 to words(Settings)
  328.             setting = word(Settings,i)
  329.             cycle id setting
  330.             call writeln(prefs,setting'='result)
  331.             end
  332.         call close(prefs)
  333.         end
  334.  
  335.     /* Save filetype settings */
  336.     do i = 1 to words(FileTypes)
  337.         type = word(FileTypes,i)
  338.         interpret 'popasl ID' type'0'
  339.         command = result
  340.         if command = '' then command = 'Multiview'
  341.         interpret type '= command'
  342.         interpret 'string ID' type'1'
  343.         interpret type '= strip('type' result)'
  344.         end
  345.  
  346.     cycle id FTYPE
  347.     UseOpus = (result == 'Directory Opus')
  348.  
  349.     if ~open(prefs,IderPrefs,'W') then call ShowMsg('Failed to save preferences')
  350.     else do
  351.         call writeln(prefs,'# IDer Prefs file - created by AACDprefs' word(sourceline(3),3)'0a'x)
  352.         call writeln(prefs,'# IDer  --  © 1995 Eclipse Software'||'0a'x)
  353.  
  354.         /* Use Opus prefs */
  355.         if UseOpus = 1 then do
  356.             signal off error
  357.             address command 'version >NIL: dopus5.library 55'
  358.             signal on error
  359.             select
  360.                 when RC = 5 then call ShowMsg('Opus filetypes need as least version 5.5 of Directory Opus')
  361.                 when ~show('P','DOPUS.1') then call ShowMsg('You need to be running Directory Opus as\nWorkbench replacement to use Opus filetypes.')
  362.                 otherwise do
  363.                     call writeln(prefs,'CLASS=Default ACTION=dopus_dclick')
  364.                     /* Ensure dopus_dclick is in path */
  365.                     signal off error
  366.                     address command 'which >NIL: dopus_dclick'
  367.                     if RC = 5 then address command 'copy CDTools/dopus_dclick C: clone'
  368.                     signal on error
  369.                     end
  370.                 end
  371.             end
  372.  
  373.         call writeln(prefs,'CLASS=IFF_Picture OFFSET=0,"FORM????ILBM" ACTION='IFF)
  374.         call writeln(prefs,'CLASS=GIF_Picture SUFFIX=.GIF OFFSET=0,"GIF87a" ACTION='GIF)
  375.         call writeln(prefs,'CLASS=JPEG_Picture OFFSET=6,4A464946 ACTION='JPG)
  376.         call writeln(prefs,'CLASS=PNG_Picture OFFSET=0,89504E47 ACTION='PNG)
  377.         call writeln(prefs,'CLASS=ANIM SUFFIX=.ANIM OFFSET=0,"FORM????ANIM" ACTION='ANM)
  378.         call writeln(prefs,'CLASS=MPEG_Video SUFFIX=.MPG ACTION='MPG)
  379.         call writeln(prefs,'CLASS=Quicktime_Movie SUFFIX=.(MOV|MV|QT) ACTION='MOV)
  380.         call writeln(prefs,'CLASS=AVI_Video SUFFIX=.AVI OFFSET=0,"RIFF" FLAGS=T ACTION='AVI)
  381.         call writeln(prefs,'CLASS=PDF_file SUFFIX=.PDF OFFSET=0,"%PDF" ACTION='PDF)
  382.         call writeln(prefs,'CLASS=IFF_Sample OFFSET=0,"FORM????8SVX" ACTION='SVX)
  383.         call writeln(prefs,'CLASS=WAV_Sample OFFSET=0,"RIFF????WAVE" ACTION='WAV)
  384.         call writeln(prefs,'CLASS=S3M_Module SUFFIX=.S3M NAME=S3M.#? OFFSET=44,"SCRM" FLAGS=T ACTION='S3M)
  385.         call writeln(prefs,'CLASS=XM_Module SUFFIX=.XM OFFSET=0,"Extended Module:" FLAGS=I ACTION='XMM)
  386.         call writeln(prefs,'CLASS=MED_Module SUFFIX=.MED NAME=MED.#? OFFSET=0,"MMD?" ACTION='MED)
  387.         call writeln(prefs,'CLASS=DBM_Module SUFFIX=.DBM OFFSET=0,"DBM0" ACTION='DBM)
  388.         call writeln(prefs,'CLASS=Module SUFFIX=.MOD NAME=MOD.#? OFFSET=1080,"M.K." FLAGS=T ACTION='MOD)
  389.         call writeln(prefs,'CLASS=MPEG_Audio NAME=(#?.MP3|#?.MP2) FLAGS=I ACTION='MP3)
  390.         call writeln(prefs,'CLASS=MIDI SUFFIX=.MID OFFSET=0,"MThd" ACTION='MID)
  391.         call writeln(prefs,'CLASS=Guide SUFFIX=.GUIDE OFFSET=0,"@database" FLAGS=I ACTION='AGD)
  392.         call writeln(prefs,'CLASS=HTML NAME=(#?.html|#?.htm) OFFSET=0,"<html" FLAGS=I ACTION='HTM)
  393.         call writeln(prefs,'CLASS=HTML2 NAME=(#?.html|#?.htm) OFFSET=0,"<!doctype" FLAGS=I ACTION='HTM)
  394.         call writeln(prefs,'CLASS=LhA_Archive NAME=(#?.LhA|?#.Lzh) OFFSET=2,"-lh?-" ACTION='LHA)
  395.         call writeln(prefs,'CLASS=Default ACTION='DEF)
  396.         call writeln(prefs,'0a'x||'#END')
  397.         call close(prefs)
  398.         end
  399.     if sav = 1 then do
  400.         address command 'copy >NIL:' CDPrefs 'ENVARC:'
  401.         address command 'copy >NIL:' IderPrefs 'ENVARC:'
  402.         end
  403.     call Quit()
  404.     return
  405. ;;;
  406. /* ;;; Show about requester */
  407. About:
  408.     request title '"'WinTitle'"' gadgets '"OK"' string VerStr' by Neil Bothwick\nCreated using MUIRexx 3.0a'
  409.     return
  410. ;;;
  411. /* ;;; Load a library */
  412. LoadLib:
  413.     parse arg library
  414.     if show('L',library) then return
  415.     if ~exists('LIBS:'library) then address command 'copy System/Libs/'library 'LIBS: clone quiet'
  416.     if ~addlib(library,0,-30,0) then call ExitMsg('Failed to load' library||'0a'x||'Make sure you have run InitCD')
  417.     return
  418. ;;;
  419. /* ;;; Check for a circular reference */
  420. Check:
  421.     arg prog
  422.     prog = strip(prog)
  423.     select
  424.         when prog = 'AACDFILE' then call ShowMsg('You cannot use AACDfile here')
  425.         when prog = 'CUCDFILE' then call ShowMsg('You cannot use CUCDfile here')
  426.         when prog = 'IDER' then call ShowMsg('You cannot use IDer here')
  427.         when pos(right(prog,9), '/AACDFILE :AACDFILE') > 0 then call ShowMsg('You cannot use AACDfile here')
  428.         when pos(right(prog,9), '/CUCDFILE :CUCDFILE') > 0 then call ShowMsg('You cannot use CUCDfile here')
  429.         when pos(right(prog,5), '/IDER :IDER') > 0 then call ShowMsg('You cannot use IDer here')
  430.         otherwise nop
  431.         end
  432.     return
  433. ;;;
  434. /* ;;; ShowMsg */
  435. ShowMsg:
  436.     parse arg msg
  437.     'request id MAIN title "'WinTitle'" gadgets "OK" string' msg
  438.     return
  439. ;;;
  440. /* ;;; Error handler */
  441. Error:
  442.     address command 'requestchoice >NIL: "error" "Error' RC 'in line' sigl'" "OK"'
  443.     if RC = 5 then return
  444.     call ShowMsg('Error' RC 'in line' sigl)
  445.     call Quit()
  446.     return
  447. ;;;
  448. /* ;;; Quit */
  449. Quit:
  450.     address(GuiPort)
  451.     'QUIT'
  452.     exit
  453. ;;;
  454.  
  455.